﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TFSRestApiHelper
{
    public class NewField
    {
        [JsonProperty("op")]
        public string op = "add";
        [JsonProperty("path")]
        public string path;
        [JsonProperty("value")]
        public object value;
    }

    public class NewLinks
    {
        [JsonProperty("op")]
        public string op = "add";
        [JsonProperty("path")]
        public string path = "/relations/-";
        [JsonProperty("value")]
        public NewLink value = new NewLink();
    }

    public class NewLink
    {
        [JsonProperty("rel")]
        public string rel;
        [JsonProperty("url")]
        public string url;
        [JsonProperty("attributes")]
        public NewLinkAtrr attributes = new NewLinkAtrr();
    }

    public class NewLinkAtrr
    {
        [JsonProperty("comment")]
        public string comment = "";
        [JsonProperty("isLocked")]
        public bool isLocked = true;
    }

    public class WIException
    {
        [JsonProperty("id")]
        public int id;
        [JsonProperty("innerException")]
        public string innerException;
        [JsonProperty("message")]
        public string message;
        [JsonProperty("typeName")]
        public string typeName;
        [JsonProperty("typeKey")]
        public string typeKey;
        [JsonProperty("errorCode")]
        public int errorCode;
        [JsonProperty("evenId")]
        public int eventId;
    }
}

